import request from '@/utils/request'

// 添加计划
export function addPlan(data) {
  return request({
    url: '/tms/transportPlan',
    method: 'POST',
    data: data
  })
}
// 更新计划
export function updatePlan(data) {
  return request({
    url: '/tms/transportPlan',
    method: 'PUT',
    data: data
  })
}
// 删除计划
export function deletePlan(id) {
  return request({
    url: '/tms/transportPlan/' + id,
    method: 'DELETE',
  })
}
// 获取计划列表
export function getList(query) {
  return request({
    url: '/tms/transportPlan/list',
    method: 'GET',
    params: query
  })
}

// 获取计划列表
export function listAll(query) {
  return request({
    url: '/tms/transportLine/listAll',
    method: 'GET',
    params: query
  })
}

// 获取计划详情
export function getPlanDetailMsg(query) {
  return request({
    url: '/tms/transportPlan/detail',
    method: 'GET',
    params: query
  })
}
//获取供应商详情
export function getSupplierDetail(id) {
  return request({
    url: '/tms/supplier/' + id,
    method: 'GET',
  })
}
//获取详情
export function getAssignPlanDetail(id) {
  return request({
    url: '/tms/transportPlan/' + id,
    method: 'GET',
  })
}
// 获取司机列表
export function getDriverList(query) {
  return request({
    url: '/tms/driver/list',
    method: 'GET',
    params: query
  })
}
// 查询运输任务详细
export function getTransportTask(id) {
  return request({
    url: '/tms/transportTask/' + id,
    method: 'get'
  })
}

// 获取车辆gpsid
export function getGpsId(query) {
  return request({
    url: '/tms/car/list/idAndCarNumber',
    method: 'GET',
    params: query
  })
}
//调度司机提交
export function assignDriver(data) {
  return request({
    url: '/tms/transportTask/add_task',
    method: 'POST',
    data: data
  })
}

